<? if(!defined('SHARE_VERSION')) exit('Access Denied');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录后台 - 系统管理</title>
<link href="<?php echo IMG;?>Admin/Login.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<?php echo PUB;?>Scripts/Msgbox/jquery.msgbox.css">
<script type="text/javascript" src="<?php echo PUB;?>Scripts/Common/jquery-1.7.min.js"></script>
<script type="text/javascript" src="<?php echo PUB;?>Scripts/Msgbox/jquery.dragndrop.min.js"></script>
<script type="text/javascript" src="<?php echo PUB;?>Scripts/Msgbox/jquery.msgbox.js"></script>
<script type="text/javascript">
function msg(str) {
	new $.msgbox({
		type: 'alert',
		content: ''+str+'',
		autoClose: 5,
		closeIcon: 'image:close.gif'
	}).show();
}
$(function(){
	$("#login_submit").click(function(){
		var user_name	= $("#user_name").val();
		var user_pwd	= $("#user_pwd").val();
		
		if ( user_name == "" ){
			msg('请填写用户名');
			return false;
		}
		if ( user_pwd == "" ){
			msg('请填写登录密码');
			return false;
		}
		var query = new Object();
		query.user_name		= user_name;
		query.user_pwd		= user_pwd;
		$("#loading").show();
		document.title='登录中...';
		$.ajax({
		 	url: "<?php echo U('login/check');?>",
		 	cache: false,
		 	type: "POST",
		 	data: query,
		 	dataType:"json",
		 	success:function(data){
			 	if ( data.status == 0 ){
				 	alert(data.msg);
					window.location.reload();
				 	return false;
			 	} else {
				 	window.location.href="<?php echo U('index');?>";
				 	return false;
			 	}
			},error:function(a,b,c){
		 		if(a.responseText)
					alert(a.responseText);
			}
		});
	});
})
</script>
</head>

<body>
<div class="login">
  <div class="logo"> <a href="http://www.itye.cn/" target="_blank"> <img src="<?php echo IMG;?>Admin/logo_login.gif" alt="后台管理系统" /> <br />
    www.itye.cn </a> </div>
  <div class="info">
    <h1 style="height:24px;"></h1>
    <div>
      <form method="post" action="<?php echo U('login/check');?>">
        <p>管理员Email<br />
          <input class="input_1" name="user_name" id="user_name" maxlength="50" value='' />
        </p>
        <p>密码<br />
          <input class="input_1" type="password" id="user_pwd" name="pwd" maxlength="50" value='' />
        </p>
        <input class="submit" type="button" id="login_submit" value="登录后台" />
        <a href="index.php">返回首页</a>
      </form>
    </div>
  </div>
</div>
<div class="loading" id="loading"></div>
</body>
</html>